
function addCompany() {
    $("#edit-modal").modal({backdrop: 'static', keyboard: false});
}

function edit_modal_close () {
    $("#co_id").val("");
    $("#hirer_id").val("");
    $("#co_code").val("");
    $("#parent_co_id").val("");
    $("#co_name").val("");
    $("#co_fullname").val("");
    $("#linkman").val("");
    $("#is_enabled").val("");
    $("#co_desc").val("");
    $("#level_num").val("");
    $("#dept_detail").val("");
    $("#disp_order").val("");
    $("#edit-modal").modal("hide");
}

function saveCompany(){
    var coId = $("#co_id").val();
    var hirerId = $("#hirer_id").val();
    var coCode = $("#co_code").val();
    var parentCoId = $("#parent_co_id").val();
    var coName = $("#co_name").val();
    var coFullName = $("#co_fullname").val();
    var linkMan = $("#linkman").val();
    var isEnabled = $("#is_enabled").val();
    var coDesc = $("#co_desc").val();
    var levelNum = $("#level_num").val();
    var deptDetail = $("#dept_detail").val();
    var dispOrder = $("#disp_order").val();
    
    $.ajax({
        url: "/manage/company/saveCompany",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify({
        	coId: coId,
        	hirerId: hirerId,
        	coCode: coCode,
        	parentCoId: parentCoId,
        	coName: coName,
        	coFullName: coFullName,
        	linkMan: linkMan,
        	isEnabled: isEnabled,
        	coDesc: coDesc,
        	levelNum: levelNum,
        	deptDetail: deptDetail,
        	dispOrder: dispOrder
        }),
        success: function (data) {
//        	viewModelCompany.sendAjaxSuccess(data);
        }
    });
}

